<div class="tabbable tabs-left">
              <ul class="nav nav-tabs">
              	<li><h5><?php echo $this->translate('Paper信息'); ?></h5></li>
                <!-- <li class="active"><a data-toggle="tab" href="#user_c"><?php echo $this->translate('客户总览'); ?></a></li> -->
                <li class="active"><a data-toggle="tab" href="#user_a"><?php echo $this->translate('基本信息'); ?></a></li>
              </ul>
              <form class="form-horizontal" enctype="multipart/form-data" name="user_add_form" id="user_add_form" method="post" action="">
              <input type="hidden" name="user_save_type" id="user_save_type" value="">
              <input type="hidden" name="user_id" id="user_id" value="<?php echo ($this->user_info ? $this->user_info->user_id : ''); ?>">
              <div class="tab-content">
    			<div id="sticky_navigation" style="height:30px;border-bottom:4px solid #DFDFDF;">
        			<div class="pull-left" style="font-size:16px;line-height:30px;"><strong><?php echo (isset($this->user_info) ? $this->translate('编辑') : $this->translate('新加')) . $this->translate(Paper); ?></strong></div>
        			<div class="pull-right">
                	<a href="<?php echo $this->url('paper/default/page',array('action'=>'paper', 'controller'=>'paper', 'page'=>$this->page), array('query'=>$this->query)); ?>" class="btn btn-small"><i class="icon-arrow-left"></i> <?php echo $this->translate('返回客户列表'); ?></a>&nbsp;
                	<a href="<?php echo $this->serverUrl(true); ?>" class="btn btn-small btn-warning"><i class="icon-repeat icon-white"></i> <?php echo $this->translate('刷新'); ?></a>&nbsp;
                    <?php if($this->user_info) { ?>
                    <a href="javascript:;" onclick="return user_del_js(<?php echo $this->user_info->user_id ?>);" class="btn btn-small btn-danger"><i class="icon-remove icon-white"></i> <?php echo $this->translate('删除客户'); ?></a>&nbsp;
                    <button type="submit" onclick="$('#user_save_type').val('save_return_edit');" class="btn btn-small btn-primary"><i class="icon-ok icon-white"></i> <?php echo $this->translate('保存客户信息并继续编辑'); ?></button>&nbsp;
                    <?php } ?>
                	<button type="submit" onclick="$('#user_save_type').val('');" class="btn btn-small btn-primary"><i class="icon-ok icon-white"></i> <?php echo $this->translate('保存客户信息'); ?></button>&nbsp;
                	</div>
        		</div>
                <div id="user_a" class="tab-pane active">
                	<div class="well admin_add_header_well"><?php echo $this->translate('基本信息'); ?></div>
                	<div class="well admin_add_well">
                	    <div class="message_one">
                    	</div>
						
						                   	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('交付时长'); ?><?php if (!$this->user_info) { ?><span class="must_add_value">*</span><?php } ?>：</label>
           					<div class="controls">
              					<input type="text" id="delivery_time"  name="delivery_time" class="span3">
            				</div>                        
                        </div>
                   	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('行间距'); ?><?php if (!$this->user_info) { ?><span class="must_add_value">*</span><?php } ?>：</label>
           					<div class="controls">
              					<input type="text" id="line_spacing"  name="line_spacing" class="span3">
            				</div>                        
                        </div>
	
                   	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('页数'); ?><?php if (!$this->user_info) { ?><span class="must_add_value">*</span><?php } ?>：</label>
           					<div class="controls">
              					<input type="text" id="pages"  name="pages" class="span3">
            				</div>                        
                        </div>
						                   	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('价格'); ?><?php if (!$this->user_info) { ?><span class="must_add_value">*</span><?php } ?>：</label>
           					<div class="controls">
              					<input type="text" id="price"  name="price" class="span3">
            				</div>                        
                        </div>
						                   	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('倍率'); ?><?php if (!$this->user_info) { ?><span class="must_add_value">*</span><?php } ?>：</label>
           					<div class="controls">
              					<input type="text" id="ratio"  name="ratio" class="span3">
            				</div>                        
                        </div>

                             <div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('创建时间'); ?>：</label>
           					<div class="controls">
              					<input type="text"  id="time"  name="time" value="<?php echo ($this->article_info ? date('Y-m-d H:i', $this->article_info->time) : ''); ?>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',el:'time'})" class="span3 Wdate">
            				</div>                        
                        </div>  
                                                                                                                       
                  	</div>
                </div>              
                    
             </div>
              </form>
</div>
<script src="<?php echo $this->basePath('/public/js/DatePicker/WdatePicker.js'); ?>"></script>
<script>
$(document).ready(function() {
	$("#user_add_form").validate({
		rules: {
			group_id: {
				required: true
			},
			<?php if (!$this->user_info) { ?>
			user_name: {
				required: true,
				maxlength:30,
				remote :{
					url : '<?php echo $this->url('frontuser/default/user_id',array('action'=>'check','controller'=>'user','check_type'=>'user_name','user_id'=>($this->user_info ? $this->user_info->user_id : '0'))); ?>',
					type : 'post',
					date : {
						user_name :function(){
							return $('#user_name').val();
						}
					}
				}
			},
			<?php } ?>
			user_email: {
				<?php if ($userEmailRegisterState == 'true') { ?>
				required: true,
				<?php } ?>
				email: true,
				remote :{
					url : '<?php echo $this->url('frontuser/default/user_id',array('action'=>'check','controller'=>'user','module'=>'user','check_type'=>'user_email','user_id'=>($this->user_info ? $this->user_info->user_id : '0'))); ?>',
					type : 'post',
					date : {
						user_email :function(){
							return $('#user_email').val();
						}
					}
				}
			},
			user_password: {
				<?php if (!$this->user_info) { ?>
				required: true,
				<?php } ?>
				minlength: 6,
				maxlength: 20
			},
			user_password_con: {
				<?php if (!$this->user_info) { ?>
				required: true,
				<?php } ?>
				minlength: 6,
				maxlength: 20,
				equalTo: '#user_password'
			},
			user_phone: {
				<?php if ($userPhoneRegisterState == 'true') { ?>
				required: true,
				<?php } ?>
				//isMobile: true,
				remote :{
					url : '<?php echo $this->url('frontuser/default/user_id',array('action'=>'check','controller'=>'user','module'=>'user','check_type'=>'user_phone','user_id'=>($this->user_info ? $this->user_info->user_id : '0'))); ?>',
					type : 'post',
					date : {
						user_phone :function(){
							return $('#user_phone').val();
						}
					}
				}
			}
			<?php if (isset($this->user_reg_extend['jsCheck']['jsStart']) and !empty($this->user_reg_extend['jsCheck']['jsStart'])) { echo ','.implode(',', $this->user_reg_extend['jsCheck']['jsStart']); } ?>
		},
		messages: {
			group_id: {
				required: "<?php echo $this->translate('请选择客户分组'); ?>"
			},
			<?php if (!$this->user_info) { ?>
			user_name: {
				required: "<?php echo $this->translate('请输入客户登录名称！'); ?>",
				maxlength:"<?php echo $this->translate('客户登录名称最长为30个汉字！'); ?>",
				remote: "<?php echo $this->translate('该用户名已经存在！'); ?>"
			},
			<?php } ?>
			user_email: {
				<?php if ($userEmailRegisterState == 'true') { ?>
				required: "<?php echo $this->translate('请输入电子邮箱！'); ?>",
				<?php } ?>
				email: "<?php echo $this->translate('电子邮箱格式错误！'); ?>",
				remote: "<?php echo $this->translate('该邮箱已经存在'); ?>"
			},
			user_password: {
				<?php if (!$this->user_info) { ?>
				required: "<?php echo $this->translate('请输入密码！'); ?>",
				<?php } ?>
				minlength: "<?php echo $this->translate('至少输入6位密码！'); ?>",
				maxlength: "<?php echo $this->translate('密码最长为20位！'); ?>"
			},
			user_password_con: {
				<?php if (!$this->user_info) { ?>
				required: "<?php echo $this->translate('请输入确认密码！'); ?>",
				<?php } ?>
				minlength: "<?php echo $this->translate('至少输入6位确认密码！'); ?>",
				maxlength: "<?php echo $this->translate('确认密码最长为20位！'); ?>",
				equalTo: "<?php echo $this->translate('两次输入的密码不一致！'); ?>"
			},
			user_phone: {
				<?php if ($userPhoneRegisterState == 'true') { ?>
				required: "<?php echo $this->translate('手机号码不能为空！'); ?>",
				<?php } ?>
				//isMobile: "<?php echo $this->translate('请输入正确的手机号码！'); ?>",
				remote: "<?php echo $this->translate('该手机号码已经存在！'); ?>"
			}
			<?php if (isset($this->user_reg_extend['jsCheck']['jsEnd']) and !empty($this->user_reg_extend['jsCheck']['jsEnd'])) { echo ','.implode(',', $this->user_reg_extend['jsCheck']['jsEnd']); } ?>
		},
		submitHandler:function(form){
			check_user_form(form);
		}
	});
<?php if ($this->user_info) { ?>
	//收货地址添加
	$("#address_add_form").validate({
		rules: {
			true_name: {
				required: true,
				maxlength:30
			},
			region_id: {
				required: true
			},
			address: {
				required: true,
				maxlength:80
			},
			mod_phone: {
				required: true
			},
			zip_code: {
				required: true
			}
		},
		messages: {
			true_name: {
				required: "<?php echo $this->translate('请输入收货人姓名！'); ?>",
				maxlength:"<?php echo $this->translate('收货人姓名最长为30个汉字！'); ?>"
			},
			region_id: {
				required: "<?php echo $this->translate('省市区不能为空'); ?>"
			},
			address: {
				required: "<?php echo $this->translate('街道地址不能为空！'); ?>",
				maxlength:"<?php echo $this->translate('街道地址最长90个汉字！'); ?>"
			},
			mod_phone: {
				required: "<?php echo $this->translate('手机号码不能为空！'); ?>"
			},
			zip_code: {
				required: "<?php echo $this->translate('邮政编码不能为空！'); ?>"
			}
		},
		submitHandler:function(form){
			address_save_js();
		}
	});
<?php } ?>
});
function check_user_form(form) {
	<?php
	if(isset($this->user_reg_extend['jsCheck']['jsCheckboxAndRadio']) and !empty($this->user_reg_extend['jsCheck']['jsCheckboxAndRadio'])) {
		echo implode('', $this->user_reg_extend['jsCheck']['jsCheckboxAndRadio']);
	} ?>

	form.submit();
}





</script>